﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace gerecord
{
    //持久化存储需要实现的接口
    public interface IUpStream<TKey, TEntity>:IDisposable
    {
        //entity 持久化保存
        Task SaveAsync(Dictionary<TKey, TEntity> entities);

        Task<TEntity> LoadAsync(TKey key);

        //更新内存中的entity 返回的Entity不能是传进去的ov 但可以是自己重新创建或者nv
        //nv是更新命令中的Entity 
        Task<TEntity> UpdateAsync(TEntity ov, TEntity nv);
    }
}
